// styles/common.scss

// 全局变量
$font-main:
  'Microsoft Yahei', 'PingFang SC', 'Avenir', 'Segoe UI', 'Hiragino Sans GB',
  'STHeiti', 'Microsoft Sans Serif', 'WenQuanYi Micro Hei', sans-serif;
$color-text: #333;
$color-bg: #f5f5f5;
$color-link: #333;

// 1. 全局重置
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  font-size: 14px;
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  color: $color-text;
  font: 1em/1.4 $font-main;
  background: $color-bg;
}

// 2. 元素重置
%reset-margin-padding {
  margin: 0;
  padding: 0;
}

body,
ul,
h1,
h3,
h4,
p,
dl,
dd {
  @extend %reset-margin-padding;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: $color-link;
  outline: none;

  &:focus-visible {
    outline: 2px solid #409eff;
    outline-offset: 2px;
  }
}

i {
  font-style: normal;
}

// 3. 表单重置
input,
textarea,
select {
  &[type='text'],
  &[type='search'],
  &[type='password'],
  &[type='checkbox'],
  & {
    padding: 0;
    border: none;
    outline: none;
    -webkit-appearance: none;
    font: inherit;

    &::placeholder {
      color: #ccc;
    }
  }
}

// 4. 图片（建议移除背景图或改用 public 路径）
img {
  max-width: 100%;
  vertical-align: middle;
  // background: #ebebeb url('/images/200.png') no-repeat center / contain;
}

// 5. 核心布局容器
.page-container {
  width: 100%;
  max-width: 1432px;
  margin: 0 auto;
  padding: 0;

  @media (min-width: 1600px) {
    padding: 0 32px;
  }
}

.fl {
  float: left;
}

.fr {
  float: right;
}

.clearfix:after {
  content: '.';
  display: block;
  visibility: hidden;
  height: 0;
  line-height: 0;
  clear: both;
}

.ellipsis {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.ellipsis-2 {
  word-break: break-all;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

// 6. App 容器（✅ 合并后只定义一次）
#app {
  min-height: 100vh;
  background: $color-bg;
}

// 7. 第三方组件覆盖
.el-breadcrumb {
  &__inner.is-link {
    font-weight: 400;
  }
}
